forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vflush: Speed up reclaim by doing less in the loop #328
Merged
lundman
merged 4 commits into
openzfsonwindows:zfs-Windows-2.2.0-release
from
EchterAgo:speed_up_reclaim
Nov 10, 2023
Merged
vflush: Speed up reclaim by doing less in the loop #328
lundman
merged 4 commits into
openzfsonwindows:zfs-Windows-2.2.0-release
from
EchterAgo:speed_up_reclaim
Nov 10, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EchterAgo
force-pushed
the
speed_up_reclaim
branch
from
November 9, 2023 15:41
e588afe
to
3fc230c
Compare
EchterAgo
force-pushed
the
speed_up_reclaim
branch
3 times, most recently
from
November 10, 2023 03:51
08a62a8
to
920fc60
Compare
lundman
approved these changes
Nov 10, 2023
EchterAgo
force-pushed
the
speed_up_reclaim
branch
2 times, most recently
from
November 10, 2023 05:35
94aa8e8
to
d3596bf
Compare
`KeQueryTickCount` seems to only have a 15.625ms resolution unless the interrupt timer frequency is increased, which should be avoided due to power usage. Instead, this switches the `zfs_lbolt`, `gethrtime` and `random_get_bytes` to use `KeQueryPerformanceCounter`. On my system this gives a 100ns resolution. Signed-off-by: Axel Gembe <[email protected]>
One less division for each call. Signed-off-by: Axel Gembe <[email protected]>
This shows how many reclaims have been processed in thousand increments and also how many reclaims are processed per second. Signed-off-by: Axel Gembe <[email protected]>
Who doesn't like statistics - apart from every human - but sometimes it can be useful, so leave it in there |
This removes leaving the `vnode_all_list_lock` in the loop as that is not needed. It also only enters the `v_mutex` of nodes that are not `VNODE_DEAD` yet. This converts part of the loop to a new function called `flush_file_objects` to make it more readable. This also removes the restart of the loop, which is safe because `vnode_all_list_lock` is never unlocked. Signed-off-by: Axel Gembe <[email protected]>
EchterAgo
force-pushed
the
speed_up_reclaim
branch
from
November 10, 2023 05:37
d3596bf
to
3b99815
Compare
lundman
merged commit Nov 10, 2023
aa83204
into
openzfsonwindows:zfs-Windows-2.2.0-release
7 checks passed
lundman
pushed a commit
that referenced
this pull request
Dec 11, 2023
* spl-time: Use KeQueryPerformanceCounter instead of KeQueryTickCount `KeQueryTickCount` seems to only have a 15.625ms resolution unless the interrupt timer frequency is increased, which should be avoided due to power usage. Instead, this switches the `zfs_lbolt`, `gethrtime` and `random_get_bytes` to use `KeQueryPerformanceCounter`. On my system this gives a 100ns resolution. Signed-off-by: Axel Gembe <[email protected]> * spl-time: Add assertion to gethrtime and cache NANOSEC / freq division One less division for each call. Signed-off-by: Axel Gembe <[email protected]> * vflush: Print reclaim statistics This shows how many reclaims have been processed in thousand increments and also how many reclaims are processed per second. Signed-off-by: Axel Gembe <[email protected]> * vflush: Speed up reclaim by doing less in the loop This removes leaving the `vnode_all_list_lock` in the loop as that is not needed. It also only enters the `v_mutex` of nodes that are not `VNODE_DEAD` yet. This converts part of the loop to a new function called `flush_file_objects` to make it more readable. This also removes the restart of the loop, which is safe because `vnode_all_list_lock` is never unlocked. Signed-off-by: Axel Gembe <[email protected]> --------- Signed-off-by: Axel Gembe <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This removes leaving the
vnode_all_list_lock
in the loop as that is not needed. It also only enters thev_mutex
of nodes that are notVNODE_DEAD
yet.This converts part of the loop to a new function called
flush_file_objects
to make it more readable.This also removes the restart of the loop, which is safe because
vnode_all_list_lock
is never unlocked.